<template>
  <div class="alert-wrap flex flex-col justify-center">
    <div class="alert bg-white px-24px py-30px relative flex flex-col">
      <div class="header relative w-full flex justify-center items-center text-white">
        <img class="confirm absolute" src="static/icons/close.png" mode="" @click="confirm" />
        <div class="title font-medium text-262A30">{{ title }}</div>
      </div>
      <div class="main text-A3A3A3 py-30px flex-center flex-1">
        {{ content }}
      </div>
      <div class="footer flex justify-center">
        <CustomButton class="block" style="width: 2.48rem" @click="confirm">{{
          confirmText
        }}</CustomButton>
      </div>
    </div>
  </div>
</template>

<script>
import CustomButton from '@/components/button'

export default {
  components: { CustomButton },
  data() {
    return {
      title: '提示',
      content: '',
      confirmText: '确认'
    }
  },
  computed: {},
  created() {},
  mounted() {},
  methods: {
    setData(data) {
      if (!data || typeof data != 'object') return

      for (let key in data) {
        this[key] = data[key]
      }
    },
    confirm() {
      this.$emit('confirm')
    }
  }
}
</script>

<style lang="scss" scoped>
.alert-wrap {
  width: 100vw;
  height: 100vh;
  background: rgba($color: #000000, $alpha: 0.5);
  position: absolute;
  left: 0;
  top: 0;
  z-index: 1999;

  .alert {
    width: 348px;
    min-height: 158px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    border-radius: 16px;
    border: 1px solid #707070;

    .header {
      .confirm {
        width: 16px;
        height: 16px;
        top: -12px;
        right: -8px;
      }

      .title {
        font-size: 22px;
        line-height: 30px;
      }
    }

    .main {
      font-size: 20px;
      line-height: 28px;
      word-break: break-all;
    }

    .footer {
    }
  }
}
</style>
